package cisdi.mes.sm.rm.daoImpl;

import java.util.List;

import org.hibernate.SessionFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.orm.hibernate3.support.HibernateDaoSupport;
import org.springframework.stereotype.Repository;

import cisdi.mes.sm.rm.dao.QualDetDao;
import cisdi.mes.sm.rm.domain.SmRmQualityElement;

@Repository
public class QualDetDaoImpl extends HibernateDaoSupport implements QualDetDao {

	@Autowired
	public void setMySessionFactory(SessionFactory sessionFactory){
		super.setSessionFactory(sessionFactory);
	}

	@SuppressWarnings("unchecked")
	@Override
	public List<SmRmQualityElement> getAna(String qualBat) {
		String queryString = "from SmRmQualityElement t";
		queryString += " where t.qualityBatch = '" + qualBat + "'";

		return this.getHibernateTemplate().find(queryString);
	}
}
